home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Yerk 3.64 / Supplement / my stuff / copyWind < prev    next >
Text File  |  1991-01-01  |  1KB  |  44 lines

  1. \ rfl    an example of a window that is updated from an offscreen bitmap
  2. \        needs to have source 'offscreen' loaded first
  3.  
  4. :CLASS copyWind <super window
  5.  
  6.     var    myImage
  7.  
  8.   :M setImage: get: contRect destRect: [ obj: myImage ]
  9.         ^base destPort: [ obj: myImage ] ;M
  10.  
  11.   :M DrawImage: draw: [ obj: myImage ] ;M
  12.  
  13.   :M new: heap> copier put: myImage
  14.         new: super setImage: self new: [ obj: myImage ] ;M
  15.  
  16.   :M close: close: super close: [ obj: myImage ] dispose: myImage ;M
  17.  
  18.   :M save: save: [ obj: myImage ] ;M
  19.  
  20.   :M setBit: set: [ obj: myImage ] ;M
  21.  
  22. ;CLASS
  23.  
  24. \ copyWind bob
  25. \ grayRgn true setDrag: bob
  26. \ false setGrow: bob    \ since destRect is set by the contRect of bob, don't want
  27. \                         \ it to grow after NEW:
  28. \ : jj 100 100 300 300 put: temprect
  29. \     temprect " help" docwind 1 1 new: bob ;
  30. \
  31. \ updates will copybits to screen
  32. \ : drawBob drawImage: bob ;
  33. \ 4 'cfas null null drawBob null actions: bob
  34. \ to draw to the offscreen port, type
  35. \   setBit: bob
  36. \   then all output will go to the offscreen bitmap.
  37. \   To draw to the screen, type
  38. \   drawImage: bob
  39.  
  40.